﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web;

/// <summary>
/// Summary description for DAL_Thuoc
/// </summary>
public class DAL_Thuoc : SqlConnectionRun
{
	public DAL_Thuoc()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public DataTable LayDanhSachThuoc(string DBName1, string DBName2, string MaND)
    {        
        string sql = @"PhongKham..Proc_LoadThuoc";
        List<SqlParameter> lst = new List<SqlParameter>();
        lst.Add(new SqlParameter("@DBName1", DBName1));
        lst.Add(new SqlParameter("@DBName2", DBName2));
        lst.Add(new SqlParameter("@MaND", MaND));  
        DataTable dt = SqlRunStoredProcedure(sql, lst);
        return dt;
    }

    public DataTable LayCachDungThuoc()
    {
        string strselect = "Select CachDung from DM_CachDungThuoc order by CachDung";
        DataTable dt = SqlExecuteQueryReader(strselect);
        return dt;
    }

    public DataTable LayDanhMucDonViDung()
    {
        string strselect = "Select DonVi from DM_DonViDung order by DonVi";
        DataTable dt = SqlExecuteQueryReader(strselect);
        return dt;
    }
}